package com.woniuxy.credit_loans.accounting_shi.controller;

import com.woniuxy.credit_loans.accounting_shi.service.LoanInfoService;
import com.woniuxy.credit_loans.audit_li.dto.MyApproval;
import com.woniuxy.credit_loans.entity.LoanInfo;
import com.woniuxy.credit_loans.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/loanInfos")
public class LoanInfoController {
    @Autowired
    private LoanInfoService loanInfoService;

    //添加审批金额
    @PostMapping("/addApproval")
    public Result addApprov(@RequestBody MyApproval myApproval){
        LoanInfo loanInfo = new LoanInfo();
        loanInfo.setDiNumber(myApproval.getDiNumber().toString());
        loanInfo.setLiLoanMoney(myApproval.getLiLoanMoney());
        int i = loanInfoService.insertSelective(loanInfo);
        return Result.ok();
    }


}
